//------------------------------------------------------------------------------
// <copyright file="Weapon.cpp" company="Microsoft">
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
//------------------------------------------------------------------------------

#include "stdafx.h"
#include "Weapon.h"

namespace Microsoft { namespace Internal { namespace GamesTest { namespace Rpc { namespace Server { namespace TestHooks
{
	Weapon::Weapon()
		: damage(0), modifier(0.0)
	{
	}

	HRESULT Weapon::FromRpcArchive(RpcArchive& archive, Weapon* result)
	{
		HRESULT hr = E_FAIL;

		if(result == nullptr)
		{
			CHK(E_INVALIDARG);
		}

		CHK(archive.GetNamedValue(L"damage", &result->damage));
		CHK(archive.GetNamedValue(L"modifier", &result->modifier));
end:
		return hr;
	}

	HRESULT Weapon::ToRpcArchive(RpcArchive* result)
	{
		HRESULT hr = E_FAIL;

		if(result == nullptr)
		{
			CHK(E_INVALIDARG);
		}

		CHK(result->SetNamedValue(L"damage", damage));
		CHK(result->SetNamedValue(L"modifier", modifier));
end:
		return hr;
	}

}}}}}}